//
//  BKAddPriceBuyCell.m
//  bestkeep
//
//  Created by ForgetFairy on 2017/5/8.
//  Copyright © 2017年 utouu. All rights reserved.
//

#import "BKAddPriceBuyCell.h"
#import "BKGDCommon.h"

@interface BKAddPriceBuyCell()

@property (nonatomic,strong) UIView *moreView;
@property (nonatomic,strong) UIImageView *saveIcon;
@property (nonatomic,strong) UIImageView *deleteIcon;

@end

@implementation BKAddPriceBuyCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self){
        
        self.mainView = [[UIView alloc] init];
        self.mainView.backgroundColor = [UIColor whiteColor];
        [self.contentView addSubview:self.mainView];
        //圈圈
        _button1 = [UIButton buttonWithType:UIButtonTypeCustom];
        [_button1 setBackgroundColor:[UIColor whiteColor]];
        [_button1 setBackgroundImage:[UIImage imageNamed:@"BKSC_unselect_image"] forState:UIControlStateNormal];
        _button1.layer.cornerRadius = 9.5f;
        _button1.layer.masksToBounds = YES;
        _button1.userInteractionEnabled = NO;
        
        [self.mainView addSubview:_button1];
        
        _imageView1 = [[UIImageView alloc] initWithFrame:CGRectZero];
        _imageView1.contentMode = UIViewContentModeScaleAspectFit;
//        _imageView1.image = [UIImage imageNamed:@"BKGDDefaultBig"];
        [self.mainView addSubview:_imageView1];
        
    
        [self.mainView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.mas_equalTo(self.contentView.mas_top);
            make.left.mas_equalTo(self.contentView.mas_left);
            make.right.mas_equalTo(self.contentView.mas_right);
            make.bottom.mas_equalTo(self.contentView.mas_bottom).mas_offset(-0.5f);
        }];
        
        
        [_button1 mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self.mainView.mas_left).offset(ApplicationBackGauge);
            
            make.width.equalTo(@(19));//18--24
            make.height.equalTo(@(19));//28--24
            
            make.centerY.mas_equalTo(self.imageView1.mas_centerY);
            
        }];
        
        [_imageView1 mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(_button1.mas_right).offset(6.0f);
            make.size.mas_equalTo(CGSizeMake(100, 100));
            make.top.mas_equalTo(self.mainView.mas_top).offset(15.0f);
        }];
        
        
        
    }
    return self;
}


-(void)goodsSelected:(BOOL)selected{
    if (selected) {
        _button1.selected = YES;
        [_button1 setBackgroundImage:[UIImage imageNamed:@"BKSC_select_image"] forState:UIControlStateSelected];
        
    }else{
        _button1.selected = NO;
        [_button1 setBackgroundImage:[UIImage imageNamed:@"BKSC_unselect_image"] forState:UIControlStateNormal];
    }
}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
    
    // Configure the view for the selected state
}

@end
